kubectl cp |
您所在的位置:网站首页 › kubectl apply -f执行顺序 › kubectl cp |
kubectl cpSynopsis Copy files and directories to and from containers. kubectl cp Examples # !!!Important Note!!! # Requires that the 'tar' binary is present in your container # image. If 'tar' is not present, 'kubectl cp' will fail. # # For advanced use cases, such as symlinks, wildcard expansion or # file mode preservation, consider using 'kubectl exec'. # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace tar cf - /tmp/foo | kubectl exec -i -n -- tar xf - -C /tmp/bar # Copy /tmp/foo from a remote pod to /tmp/bar locally kubectl exec -n -- tar cf - /tmp/foo | tar xf - -C /tmp/bar # Copy /tmp/foo_dir local directory to /tmp/bar_dir in a remote pod in the default namespace kubectl cp /tmp/foo_dir :/tmp/bar_dir # Copy /tmp/foo local file to /tmp/bar in a remote pod in a specific container kubectl cp /tmp/foo :/tmp/bar -c # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace kubectl cp /tmp/foo /:/tmp/bar # Copy /tmp/foo from a remote pod to /tmp/bar locally kubectl cp /:/tmp/foo /tmp/bar Options-c, --container stringContainer name. If omitted, use the kubectl.kubernetes.io/default-container annotation for selecting the container to be attached or the first container in the pod will be chosen -h, --helphelp for cp --no-preserveThe copied file/directory's ownership and permissions will not be preserved in the container --retries intSet number of retries to complete a copy operation from a container. Specify 0 to disable or any negative value for infinite retrying. The default is 0 (no retry). --as stringUsername to impersonate for the operation. User could be a regular user or a service account in a namespace. --as-group stringsGroup to impersonate for the operation, this flag can be repeated to specify multiple groups. --as-uid stringUID to impersonate for the operation. --cache-dir string Default: "$HOME/.kube/cache"Default cache directory --certificate-authority stringPath to a cert file for the certificate authority --client-certificate stringPath to a client certificate file for TLS --client-key stringPath to a client key file for TLS --cloud-provider-gce-l7lb-src-cidrs cidrs Default: 130.211.0.0/22,35.191.0.0/16CIDRs opened in GCE firewall for L7 LB traffic proxy & health checks --cloud-provider-gce-lb-src-cidrs cidrs Default: 130.211.0.0/22,209.85.152.0/22,209.85.204.0/22,35.191.0.0/16CIDRs opened in GCE firewall for L4 LB traffic proxy & health checks --cluster stringThe name of the kubeconfig cluster to use --context stringThe name of the kubeconfig context to use --default-not-ready-toleration-seconds int Default: 300Indicates the tolerationSeconds of the toleration for notReady:NoExecute that is added by default to every pod that does not already have such a toleration. --default-unreachable-toleration-seconds int Default: 300Indicates the tolerationSeconds of the toleration for unreachable:NoExecute that is added by default to every pod that does not already have such a toleration. --disable-compressionIf true, opt-out of response compression for all requests to the server --insecure-skip-tls-verifyIf true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure --kubeconfig stringPath to the kubeconfig file to use for CLI requests. --match-server-versionRequire server version to match client version -n, --namespace stringIf present, the namespace scope for this CLI request --password stringPassword for basic authentication to the API server --profile string Default: "none"Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex) --profile-output string Default: "profile.pprof"Name of the file to write the profile to --request-timeout string Default: "0"The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. -s, --server stringThe address and port of the Kubernetes API server --storage-driver-buffer-duration duration Default: 1m0sWrites in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction --storage-driver-db string Default: "cadvisor"database name --storage-driver-host string Default: "localhost:8086"database host:port --storage-driver-password string Default: "root"database password --storage-driver-secureuse secure connection with database --storage-driver-table string Default: "stats"table name --storage-driver-user string Default: "root"database username --tls-server-name stringServer name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used --token stringBearer token for authentication to the API server --user stringThe name of the kubeconfig user to use --username stringUsername for basic authentication to the API server --version version[=true]--version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version --warnings-as-errorsTreat warnings received from the server as errors and exit with a non-zero exit code See Alsokubectl - kubectl controls the Kubernetes cluster managerThis page is automatically generated. If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project. FeedbackWas this page helpful? Thanks for the feedback. If you have a specific, answerable question about how to use Kubernetes, ask it on Stack Overflow. Open an issue in the GitHub Repository if you want to report a problem or suggest an improvement. Last modified April 18, 2024 at 6:36 PM PST: Update kubectl reference for v1.30 (a6ccd20be9) |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |